package com.xmy.cultivate.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xmy.cultivate.enums.SexEnum;
import com.xmy.cultivate.enums.StatusStaffEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 员工
 * </p>
 *
 * @author min
 * @since 2022-07-28
 */
@Data
public class Staff implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @ExcelIgnore
    private Long id;

    @ExcelIgnore
    private Long companyId;

    /**
     * 所属校区
     */
    @ExcelIgnore
    private Long schoolId;

    @ExcelIgnore
    @TableField(exist = false)
    private String schoolName;

    /**
     * 姓名
     */
    @ExcelProperty(index = 0,value = "姓名")
    private String name;

    /**
     * 头像
     */
    @ExcelIgnore
    private String headImg;

    @ExcelIgnore
    private Integer IsGather;

    /**
     * 手机号
     */
    @ExcelIgnore
    private String phone;

    /**
     * 企业微信id，会根据手机号自动同步企业微信通讯讯数据
     */
    @ExcelIgnore
    private String qyWecharId;

    /**
     * 性别：1男，2女，3未知
     */
    @ExcelIgnore
    private SexEnum sex;

    /**
     * 0待入职，1员工，2离职,试岗,未入职
     */
    @ExcelIgnore
    private StatusStaffEnum status;

    /**
     * 上课校区范围：1全部校区，2指定校区
     */
    @ExcelIgnore
    private Integer scopeClassMode;

    /**
     * 是否教师
     */
    @ExcelIgnore
    private Integer isTeacher;

    /**
     * 教师类型（老师，助教）
     */
    @ExcelIgnore
    private Integer teacherType;

    @ExcelIgnore
    private String siginSubjects;

    /**
     * 员工类型
     */
    @ExcelIgnore
    private Integer staffType;

    @ExcelIgnore
    @TableField(exist = false)
    private String staffTypeName;

    /**
     *0待转正，1已转正，2转正失败
     */
    @ExcelIgnore
    private Integer justType;

    /**
     * 对应字典表num
     */
    @ExcelIgnore
    private Integer courseInId;

    /**
     * 多少个课时，如三个课时
     */
    @ExcelIgnore
    private Integer courseInCount;

    /**
     * 多少钱：如三个课时对应的300元
     */
    @ExcelIgnore
    private BigDecimal courseInMoney;

    /**
     * 身份证
     */
    @ExcelIgnore
    private String cardId;

    /**
     * 生日
     */
    @ExcelIgnore
    private String birthday;

    /**
     * 英文名
     */
    @ExcelIgnore
    private String enName;

    /**
     * 邮箱
     */
    @ExcelIgnore
    private String email;

    /**
     * 籍贯
     */
    @ExcelIgnore
    private String nativePlace;

    /**
     * 民族
     */
    @ExcelIgnore
    private String nation;

    /**
     * 政治（对应字典表）
     */
    @ExcelIgnore
    private Integer politics;

    /**
     * 婚姻（对应字典表）
     */
    @ExcelIgnore
    private Integer marriage;

    /**
     * 专业
     */
    @ExcelIgnore
    private String major;

    /**
     * 培训经历
     */
    @ExcelIgnore
    private String training;

    /**
     * 其它
     */
    @ExcelIgnore
    private String other;

    /**
     * 标记
     */
    @ExcelIgnore
    private String sign;

    /**
     * 合同开始时间
     */
    @ExcelIgnore
    private String contractStart;

    /**
     * 合同结束时间
     */
    @ExcelIgnore
    private String contractEnd;

    /**
     * 是否签劳动合同
     */
    @ExcelIgnore
    private Integer laborContract;

    /**
     * 劳动关系（对应字典表）
     */
    @ExcelIgnore
    private Integer laborRelation;

    /**
     * 转正日期
     */
    @ExcelIgnore
    private String justDate;

    /**
     * 入职日期(此日期作废，使用entry_date)
     */
    //@ExcelIgnore
    //private LocalDate inDate;

    /**
     * 预试岗日期
     */
    @ExcelIgnore
    private LocalDate tryAdvanceDate;

    @ExcelIgnore
    private LocalDate tryStartDate;

    @ExcelIgnore
    private LocalDate tryEndDate;

    @ExcelIgnore
    private Long stationId;


    /**
     * 岗位名称
     */
    @ExcelIgnore
    @TableField(exist = false)
    private String stationName;

    /**
     * 直属上级id
     */
    @ExcelIgnore
    private Long superiorId;

    @ExcelIgnore
    @TableField(exist = false)
    private String superiorName;

    /**
     * 工资卡号
     */
    @ExcelIgnore
    private String cardCode;

    /**
     * 工资卡开户行
     */
    @ExcelIgnore
    private String cardBank;

    /**
     * 社保（对应字典表）
     */
    @ExcelIgnore
    private Integer social;

    /**
     * 登录账号:0为未绑定
     */
    @ExcelIgnore
    private Long adminId;

    /**
     * 创建人id
     */
    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT)
    private Long createdId;

    @ExcelIgnore
    @ApiModelProperty("是否删除，0正常，1删除")
    @TableLogic(value = "0", delval = "1")
    @TableField(select = false)
    private Integer deleted;

    /**
     * 入职日期
     */
    @ExcelIgnore
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate entryDate;

    /**
     * 离职日期
     */
    @ExcelIgnore
//    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate leaveDate;

    /**
     * created_at
     */
    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * updated_at
     */
    @ExcelIgnore
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updatedAt;

    /**
     * deleted_at
     */
    @ExcelIgnore
    private LocalDateTime deletedAt;

    @ExcelIgnore
    @TableField(exist = false)
    private Admin adminObj;

    //所属部门
    @ExcelIgnore
    @TableField(exist = false)
    private List<Organization> departList;

    //上课校区范围,指定校区
    @ExcelIgnore
    @TableField(exist = false)
    private List<Long> scopeSchoolIdList;

    //所属部门
    @ExcelIgnore
    @TableField(exist = false)
    private List<Long> departIdList;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer working;

    @ExcelProperty(index = 1,value = "工龄时长")
    @TableField(exist = false)
    private String workingStr;

    @ExcelProperty(index = 3,value = "在职时间")
    @TableField(exist = false)
    private String dateStr;

    @ExcelProperty(index = 2,value = "状态")
    @TableField(exist = false)
    private String statusStr;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer subjectsId;

    @ExcelIgnore
    @TableField(exist = false)
    private Long roleId;

    /*
     * 入职信息
     */
    @ExcelIgnore
    @TableField(exist = false)
    private StaffStatusChange statusChange;

    /*
     * 离职信息，状态信息
     */
    @ExcelIgnore
    @TableField(exist = false)
    private StaffStationChange staffStationChange;

    /**
     * 注册id
     */
    @ExcelIgnore
    @TableField(exist = false)
    private Long regId;

    /**
     * 员工财务权限
     */
    @ExcelIgnore
    @TableField(exist = false)
    private List<Long> staffPermissionList;

    /**
     * 员工教务权限
     */
    @ExcelIgnore
    @TableField(exist = false)
    private List<Long> mobileStaffPermissionList;

    @TableField(exist = false)
    @ApiModelProperty("多个年级id")
    private String yearClassIds;

    @TableField(exist = false)
    @ApiModelProperty("勾选年级")
    private String yearClassName;

    @TableField(exist = false)
    @ApiModelProperty("老师带班年级手动")
    private List<TeacherLeadsYearClass>  teacherLeadsYearClassList;

//    @TableField(exist = false)
//    @ApiModelProperty("老师自动导入带班")
//    private List<AuToTeacherLeadsYearClass>  AuToTeacherLeadsYearClassList;

    @TableField(exist = false)
    @ApiModelProperty("老师带班年级手动id")
    private List<Integer>  teacherLeadsYearClassIdList;

    @TableField(exist = false)
    @ApiModelProperty("宿舍长")
    private String staffName;

}
